package com.coding.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author Cynicism
 * @version 1.0
 * @project ChatDemo
 * @description
 * @date 2024/6/22 10:34:18
 */
@Mapper
public interface BlacklistMapper {
    @Select("SELECT 1 FROM blacklist WHERE user_id = #{userId} AND blocked_user_id = #{blockedUserId} Limit 1")
    Integer isBlocked(@Param("userId") Long userId, @Param("blockedUserId") Long blockedUserId);


    @Select("INSERT INTO blacklist (user_id, blocked_user_id) VALUES (#{userId}, #{blockedUserId})")
    Integer insert(@Param("userId") Long userId, @Param("blockedUserId") Long blockedUserId);
}
